import { message, Upload } from 'antd'
import { InboxOutlined } from '@ant-design/icons'

export const UploadFile = () => {
  return (
    <Upload.Dragger
      name="file"
      multiple
      accept=".pdf,.doc,.docx,.jpg,.png"
      beforeUpload={() => false}
      showUploadList
      onChange={({ file }) => file.status === 'done' && message.success('上传成功')}
    >
      <p className="ant-upload-drag-icon">
        <InboxOutlined />
      </p>
      <p className="ant-upload-text">点击或拖拽文件到此处上传</p>
      <p className="ant-upload-hint">支持 PDF, DOC, DOCX, JPG, PNG</p>
    </Upload.Dragger>
  )
}
